﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using MixScript.BLL.FI;

namespace MixScriptWeb.Accounting.ReportFinnance
{
    public partial class BalanceSheet_Rpt : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

            DataTable dt = new DataTable();
            DataTable dt2 = new DataTable();
            cBalanceSheet balance = new cBalanceSheet();
            dt = balance.ListOfData("1");
            dt2 = balance.ListOfData("3");
            rptCurrent.DataSource = dt;
            rptLiabilities.DataSource = dt2;
            rptCurrent.DataBind();
            rptLiabilities.DataBind();
            //rptLaporan.DataSource = dt;
            //rptLaporan.DataBind();
        }

        protected void rptLaporan_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            Repeater subrepeter = new Repeater();
            if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem))
            {
                Label idLbl = new Label();
                idLbl = (Label)e.Item.FindControl("lblID");
                subrepeter = (Repeater)e.Item.FindControl("rptSubLaporan");
                cBalanceSheet istatment = new cBalanceSheet();
                subrepeter.DataSource = istatment.SubListOfData(idLbl.Text);
                subrepeter.DataBind();


                Label lblName = new Label();
                lblName = (Label)e.Item.FindControl("lblName");
                Label lblProfit = new Label();
                LiteralControl lt = new LiteralControl();
            }
        }
        protected void rptLaporan1_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            Repeater subrepeter = new Repeater();
            if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem))
            {
                Label idLbl = new Label();
                idLbl = (Label)e.Item.FindControl("lblID");
                subrepeter = (Repeater)e.Item.FindControl("rptSubLaporan");
                cBalanceSheet istatment = new cBalanceSheet();
                subrepeter.DataSource = istatment.SubListOfData(idLbl.Text);
                subrepeter.DataBind();


                Label lblName = new Label();
                lblName = (Label)e.Item.FindControl("lblName");
                Label lblProfit = new Label();
                LiteralControl lt = new LiteralControl();
            }
        }
        protected void rptSubLaporan_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem))
            {
                Label idLbl = new Label();
                Label idCurrent = new Label();
                Label idAccumulated = new Label();
                idLbl = (Label)e.Item.FindControl("lblSubNameID");
                idCurrent = (Label)e.Item.FindControl("idCurrent");
                cBalanceSheet istatment = new cBalanceSheet();
                Decimal curr;

                curr = istatment.getCurrent(idLbl.Text);
                idCurrent.Text = curr.ToString();
                
            }
        }
        protected void rptSubLaporan1_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem))
            {
                Label idLbl = new Label();
                Label idCurrent = new Label();
                Label idAccumulated = new Label();
                idLbl = (Label)e.Item.FindControl("lblSubNameID");
                idCurrent = (Label)e.Item.FindControl("idCurrent");
                cBalanceSheet istatment = new cBalanceSheet();
                Decimal curr;

                curr = istatment.getCurrent(idLbl.Text);
                idCurrent.Text = curr.ToString();

            }
        }

    }
}